require.config({
    paths: {
        $: './zepto.min'
    }
});

require(['$'], function ($) {
  
   
    //点击返回按钮
    $("#goback").click(function () {
        window.history.go(-1);//返回上一页不刷新  
        //window.location.href = document.referrer;//返回上一页并刷新
    });
    var zhifubao = $('#zhifubao');
    var weixin =$('#weixin');
    var payMethod=2;
    zhifubao.click(function () {
        payMethod=2;
        $(this).removeClass('unselect').addClass('select');
        weixin.removeClass("select").addClass('unselect');
    });
    
    weixin.click(function () { 
        payMethod=1;
        $(this).removeClass('unselect').addClass('select');
        zhifubao.removeClass("select").addClass('unselect');
    });

    $("#pay").click(function () {
        $("#pay_type").val(payMethod)
        $("#submit_form").submit();
        console.log(payMethod);//支付方式 1表示支付宝 2 表示微信
    });

   
});